Stochastic maximum principle for optimal control of a class of nonlinear spdes with dissipative drift