WASHINGTON — The United States will restore full diplomatic relations with Cuba and open an embassy in Havana for the first time in more than a half-century after the release of an American contractor held in prison for five years, American officials said Wednesday.