We incorporate quasars into an analytic model to describe the reheating and reionization of the universe . In combination with a previous study of galaxies and Lyman- \alpha clouds , we are able to provide a unified description of structure formation , verified against a large variety of observations . We also take into account the clumping of the baryonic gas in addition to the presence of collapsed objects . We consider two cosmologies : a critical universe with a CDM power-spectrum and an open universe with \Omega _ { 0 } = 0.3 , \Lambda = 0 . The derived quasar luminosity function agrees reasonably well with observations at z < 4.5 and with constraints over larger redshifts from the HDF . The radiation produced by these objects at z \sim 16 slowly reheats the universe which gets suddenly reionized at z _ { ri } = 6.8 for the open universe ( z _ { ri } = 5.6 for the critical density universe ) . The UV background radiation simultaneously increases sharply to reach a maximum of J _ { 21 } = 0.18 at z = 2.6 , but shows strong ionization edges until z \leq 1 . The metallicity of the gas increases quickly at high z and is already larger than 0.01 Z _ { \odot } at z = 10 . The QSO number counts and the helium opacity constrain the reionization redshift to be z _ { ri } \sim 6 . We confirm that a population of faint quasars is needed in order to satisfy the observations . Due to the low reionization redshift , the damping of CMB fluctuations is quite small , but future observations ( e.g . with the NGST ) of the multiplicity functions of radiation sources and of the HI and HeII opacities will strongly constrain scenarios in which reionization is due to QSOs . The reasonable agreement of our results with observations ( for galaxies , quasars , Lyman- \alpha clouds and reionization constraints ) suggests that such a model should be fairly realistic .