Moral Hazard and Efficiency in a Frictional Market