Oil prices edged higher after data showed that US gasoline inventories hit a two-year low in the latest week, offsetting worries about rising supply amid slow demand growth.