An asymptotic formula for polynomials orthonormal with respect to a varying weight