Reionization with galaxies and active galactic nuclei