Necessary conditions for optimality of singular controls in systems governed by partial differential equations