Stochastic maximum principle for optimal control of SPDEs