An endogenous growth model with endogenous fertility