Oil gains for 4th day on signs of output cuts, better demand