Regularity for nonuniformly elliptic systems and application to some variational integrals