The effect of active galactic nuclei feedback on the halo mass function