Measuring the lensing potential with tomographic galaxy number counts