President Donald Trump told Spain’s leader Mariano Rajoy on Tuesday that the United States is committed to NATO, the White House said, despite his past criticism of the transatlantic military alliance.