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 B(N) by means of the sensitive resistive detection. We find the dependence of B(N) on the filling factor nonmonotonic. The comprehensive measurements of B(N) 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 B(N) is understood by the effect of electron spin polarization through excitons and trions.