Variational approach to the copropagation of an ultrashort laser pulse with an electron plasma wave