We consider the effects of quantitative easing on liquidity and prices of bonds in a search-and matching model. The model explicitly distinguishes between demand and supply effects of central bank asset purchases. Both are shown to lead to a decline in yields, while they have opposite effects on market liquidity. This results in a price-liquidity trade-off. Initially, liquidity improves in reaction to central bank demand. As the central bank buys and holds bonds, supply becomes scarcer and other buyers are crowded out. As a result, liquidity can fall below initial levels. The magnitude of the effects depend on the presence of preferred habitat investors. In markets with a higher share of these investors, bonds are scarcer and central bank asset purchases lower yields more. With a lower share of preferred habitat investors and a relatively illiquid market, central bank demand has a stronger positive effect on liquidity. We are the first to construct an index from bond holding data to measure the prevalence of preferred habitat investors in each euro area country. Subsequently, we calibrate the model to the euro area and show how yields and liquidity are affected by the European Central Banks asset purchase programme.