A model for two-phase flow with hysteresis