Non perturbative approach for a polar and polarizable linear molecule in an inhomogeneous electric field: Application to molecular beam deviation experiments