Energy-momentum tensor for a scalar field on manifolds with boundaries