Numerical simulation of electrohydrodynamic flows of Newtonian and viscoelastic droplets