An interpolation of Jensen's inequality and its converses with applications to quasi-arithmetic mean inequalities