  We investigate the implications of the intergalactic opacity for the
evolution of the cosmic UV luminosity density and its sources. Our main
constraint is our measurement of the Lya forest opacity at redshifts 2<z<4.2
from 86 high-resolution quasar spectra. In addition, we impose the requirements
that HI must be reionized by z=6 and HeII by z~3, and consider estimates of the
hardness of the ionizing background from HI to HeII column density ratios. The
derived hydrogen photoionization rate is remarkably flat over the Lya forest
redshift range covered. Because the quasar luminosity function is strongly
peaked near z~2, the lack of redshift evolution indicates that star-forming
galaxies likely dominate the photoionization rate at z>~3. Combined with direct
measurements of the galaxy UV luminosity function, this requires only a small
fraction f_esc~0.5% of galactic hydrogen ionizing photons to escape their
source for galaxies to solely account for the entire ionizing background. Under
the assumption that the galactic UV emissivity traces the star formation rate,
current state-of-the-art observational estimates of the star formation rate
density appear to underestimate the total photoionization rate at z~4 by a
factor ~4, are in tension with recent determinations of the UV luminosity
function, and fail to reionize the Universe by z~6 if extrapolated to
arbitrarily high redshift. A theoretical star formation history peaking earlier
fits the Lya forest photoionization rate well, reionizes the Universe in time,
and is in better agreement with the rate of z~4 gamma-ray bursts observed by
Swift. Quasars suffice to doubly ionize helium by z~3 and likely contribute a
non-negligible and perhaps dominant fraction of the hydrogen ionizing
background at their z~2 peak. [Abridged]
