We consider two candidates for the sources of the ionizing background: primeval galaxies and AGN-type objects. The spectrum of the diffuse radiation field is computed taking into account the opacity of intervening Lyα clouds and Lyman limit systems. We assess the possibility that the QSO heavy-element absorption systems are photoionized by a metagalactic flux which is dominated by the UV radiation from hot stars in young galaxies. Grids of photoionization models for metal-line systems are presented, and it is argued that the relative column densities of the most abundant ions predicted by the models are compatible with the observational constraints. We discuss the inferred physical properties of the absorbing clouds. Given that the observed QSOs cannot provide the required number of ionizing photons at high redshift, the results obtained support a scenario in which young, star-forming galaxies are the main sources of the UV radiation background at early epochs.