The US and Cuba have officially restored diplomatic relations, opening embassies in Washington and Havana.