UPDATE 5-Oil eases on U.S. holiday after 8 days of gains

* Many traders close positions ahead of July 4 holiday

* Easing U.S. output, drilling activity has supported market

* Rising OPEC production still weighs on prices (Updates prices)

LONDON, July 4 (Reuters) - Oil prices fell on Tuesday, as investors booked profits on an eight-day rally that was triggered by tentative signs that a persistent rise in U.S. crude production may be slowing.

Brent crude futures fell by 15 cents to $49.53 per barrel by 1138 GMT.

U.S. West Texas Intermediate (WTI) crude futures were trading down 12 cents at $46.95 a barrel.

The falls came after both benchmarks recovered around 12 percent from their recent lows on June 21.

Many traders closed positions ahead of the U.S. Independence Day holiday on July 4, while Brent also faced technical resistance as it approached $50 per barrel, traders said.

Despite this, the market's outlook has shifted somewhat.

Late May and most of June were overwhelmingly bearish as U.S. output rose and doubts grew over the ability of the Organization of the Petroleum Exporting Countries (OPEC) to hold back enough production to tighten the market.

But sentiment began to shift towards the end of June, when U.S. data showed a dip in American oil output and a slight fall in drilling for new production. <RIG-OL-USA-BHI> <C-OUT-T-EIA>

"The fact that prices have not come under any noticeable pressure of late points to a shift in sentiment," Commerzbank said on Tuesday.

"This may be related to the fact that most of the 'shaky hands' have withdrawn from the market by now," the bank added.

Prices rose in recent days despite OPEC production hitting a 2017 high of 32.72 million barrels a day in June, according to a Reuters survey.

The group's efforts to rebalance the market have been undermined by rising production from Libya and Nigeria, who are exempt from the cuts.

Libya is currently pumping around 1 million bpd of crude, a four-year high.

OPEC exports rose for a second month in a row in June to 25.92 million bpd, a rise of 1.9 million bpd compared with the same month last year, according to a report by Thomson Reuters Oil Research.

"We see a recovery for oil prices in H2 2017 from current levels, with OPEC production cuts, a slowdown in global supply growth and seasonally firming demand driving up prices," BMI Research said, although it added that "large-volume supply additions will keep price growth flat year on year in 2018".

BMI said it expected Brent to average $54 per barrel in the second half of this year, and to average $55 a barrel in 2018.

It expects WTI to average $51 in the second half of 2017 and $52 next year. (Additional reporting by Henning Gloystein in Singapore; editing by Jason Neely)