Effect of intersystem crossing rates and optical illumination on the polarization of nuclear spins close to nitrogen-vacancy centers