The Senate has confirmed Marco Rubio as secretary of state, giving President Donald Trump the first member of his Cabinet.