Oil gains on second day as weak demand urges output cut