The joint communique followed weeks of tension between U.S. allies and President Donald Trump over his upending of Western trade, security and Ukraine-related policy.