An economic model of cohabitation and divorce