Firmer energy stocks and takeover activity helped European shares to edge higher on Tuesday, recovering some ground following a retreat in the previous session prompted by worries over political stalemate in Spain. Trading was volatile as the holiday season approached and some investors remained cautious over prospects for next year. The pan-European FTSEurofirst 300 index, which had fallen 1.2 percent on Monday, edged up 0.15 percent by 1537 GMT, while the euro zone's blue-chip Euro STOXX 50 index was up 0.3 percent. "There are no easy gains to make," said Marco Vailati, head of research and investment at Italy's Cassa Lombarda. "Companies must deliver on the earnings front, the Greek crisis is still unresolved and there is political instability in Spain. Against this uncertain backdrop, investors should be opportunistic and seek to buy on the dips and sell during the moments of euphoria," he said. The FTSEurofirst and Euro STOXX 50 are both up by around 3 percent this year, with economic stimulus from the European Central Bank having helped support markets despite a slowdown in China and political uncertainty in Spain and Greece. On Tuesday, oil stocks such as BP and Royal Dutch Shell recovered as oil prices edged away from multi-year lows. "The oil price is still the big driver of market sentiment at the moment for stock markets, but I'm not sure if it will hold above those lows, given the concerns about a glut of supply," said Hantec Markets' analyst Richard Perry. Nevertheless, there was further support for stocks in the form of takeover activity, which gave a boost to markets after the pullback on Monday. Shares in USG People surged 28 percent after Japanese employment agency Recruit agreed to buy the Dutch staffing company for 1.4 billion euros, a 31 percent premium to its Monday closing price. Finnish software company Innofactor also rose 7 percent after it announced plans to merge with Swedish Cinteros AB. The Madrid bourse was up 0.6 percent as it rebounded from a sell-off in the previous session after an inconclusive election result. Despite the uncertainty, the Bank of Spain increased its growth forecasts for the Spanish economy but warned over risks for reforms and budget policies.