On the Evolution of Ultracompact H II Regions