Quadratic congruences modulo a prime