Senate confirms Hagel for defense secretary