Variational problems for sub–Finsler metrics in Carnot groups and Integral Functionals depending on vector fields