Optimality principle and synthesis for a stochastic control problem in Hilbert spaces.