Oil futures ended higher Thursday, with investors shaking off a larger-than-expected rise in U.S. crude inventories.