Regularization of the stress-energy tensor for vector and scalar particles propagating in a general background metric