Liouvillian and analytic integrability of the quadratic vector fields having an invariant ellipse