Constrained variational calculus for higher order classical field theories