Existence and uniqueness of solutions to a class of stochastic partial differential equations