A model of currency crises with heterogeneous market beliefs