We incorporate a simple scheme for the growth of supermassive black holes i
nto semi-analytic models that follow the formation and evolution of galaxie
s in a cold dark matter-dominated Universe. We assume that supermassive bla
ck holes are formed and fuelled during major mergers. If two galaxies of co
mparable mass merge, their central black holes coalesce and a few per cent
of the gas in the merger remnant is accreted by the new black hole over a t
ime-scale of a few times 10(7) yr. With these simple assumptions, our model
not only fits many aspects of the observed evolution of galaxies, but also
reproduces quantitatively the observed relation between bulge luminosity a
nd black hole mass in nearby galaxies, the strong evolution of the quasar p
opulation with redshift, and the relation between the luminosities of nearb
y quasars and those of their host galaxies. The strong decline in the numbe
r density of quasars from z similar to 2 to z=0 is a result of the combinat
ion of three effects: (i) a decrease in the merging rate; (ii) a decrease i
n the amount of cold gas available to fuel black holes, and (iii) an increa
se in the time-scale for gas accretion. The predicted decline in the total
content of cold gas in galaxies is consistent with that inferred from obser
vations of damped Ly alpha systems. Our results strongly suggest that the e
volution of supermassive black holes, quasars and starburst galaxies is ine
xtricably linked to the hierarchical build-up of galaxies.