Dispersive optical nonlinearities in a Rydberg electromagnetically-induced-transparency medium