A consequentialist model for just social contracts