We study nuclear spin polarization in the quantum Hall regime through the optically pumped electron spin polarization in the lowest Landau level. The nuclear spin polarization is measured as a nuclear magnetic field BN by means of the sensitive resistive detection. We find the dependence of BN on the filling factor nonmonotonic. The comprehensive measurements of BN with the help of the circularly polarized photoluminescence measurements indicate the participation of the photoexcited complexes, i.e., the exciton and trion (charged exciton), in nuclear spin polarization. On the basis of a novel estimation method of the equilibrium electron spin polarization, we analyze the experimental data and conclude that the filling factor dependence of BN is understood by the effect of electron spin polarization through excitons and trions.