Oil edges up, breaking six-day stretch of losses