A variational approach to the Hele-Shaw flow with injection