Hysteresis in a transition to chaos