Context. Establishing the number of faint active galactic nuclei (AGNs) at z = 4−6 is crucial to understanding their cosmological importance as main contributors to the reionization of the Universe. Aims. In order to derive the AGN contribution to the cosmological ionizing emissivity we have selected faint AGN candidates at z > 4 in the CANDELS GOODS-South field, which is one of the deepest fields with extensive multiwavelength coverage from Chandra, HST, Spitzer, and various ground-based telescopes. Methods. We have adopted a relatively novel criterion. As a first step, high redshift galaxies are selected in the NIR H band down to very faint levels (H ≤ 27) using reliable photometric redshifts. At z > 4 this corresponds to a selection criterion based on the galaxy rest-frame UV flux. AGN candidates are then picked up from this parent sample if they show X-ray fluxes above a threshold of F X ∼ 1.5 × 10 −17 erg cm −2 s −1 (0.5−2 keV), corresponding to a probability of spurious detections of 2 × 10 −4 in the deep X-ray 4 Ms Chandra image. Results. We have found 22 AGN candidates at z > 4 and we have derived the first estimate of the UV luminosity function in the redshift interval 4 < z < 6.5 and absolute magnitude interval −22.5 M 1450 −18.5 typical of local Seyfert galaxies. The faint end of the derived luminosity function is about two to four magnitudes fainter at z ∼ 4−6 than that derived from previous UV surveys. We estimated ionizing emissivities and hydrogen photoionization rates in the same redshift interval under reasonable assumptions and after discussion of possible caveats, the most important being the large uncertainties involved in the estimate of photometric redshift for sources with featureless, almost power-law SEDs and/or low average escape fraction of ionizing photons from the AGN host galaxies. Both effects could, in principle, significantly reduce the estimated average volume densities and/or ionizing emissivities, especially at the highest redshifts. Conclusions. At z = 4−6.5 we argue that, under reasonable evaluations of possible biases, the probed AGN population can produce photoionization rates consistent with that required to keep the intergalactic medium observed in the Lyman-α forest of high redshift QSO spectra highly ionized, providing an important contribution to the cosmic reionization.