Forward--backward parabolic equations and hysteresis