Variable phase approach to potential scattering