This paper explores the apparent tension between Hayek's moral skepticism and his role as a defender of liberal institutions. It looks at Hayek's concept of spontaneous order, and asks whether there are any grounds for claiming that spontaneous orders have moral value. The argument from group selection is considered but rejected. Hayek is interpreted as putting most weight on arguments which show, for specific orders (such as the market and common law) that their rules assist each individual in the pursuit of his or her ends, whatever those ends may be. It is suggested that this form of argument is contractarian in character. However, Hayek's contractarianism is distinctive in that it looks for agreement among individuals within an ongoing social order, rather than among rational agents who stand outside any particular society.