The exchange energy of a nonuniform electron gas