On the dynamical and arithmetic degrees of rational self-maps of algebraic varieties