On a constrained variational problem in the vector-valued case