Variational formulation of covariant eikonal theory for vector waves