HSBC Britain’s biggest bank, has issued a stark warning about the economic risks of the UK pulling out of the European Union as it revealed it was considering moving its headquarters out of London.

The unexpected announcement of a full-blown review into where the bank should base its operations, just two week before the general election, was seized on by politicians on the campaign trail.

HSBC said “regulatory and structural reforms” in the wake of the banking crisis had led to the decision.

The chairman, Douglas Flint, also highlighted the economic uncertainty created by the risk of the UK leaving Europe – a blow to the Conservatives, who have pledged to hold an “in-out” referendum on the EU if they win the general election.

HSBC has been hit hard the banking levy, which last year cost it $1.1bn (£730m), up from $200m in 2013. Flint denied playing politics, adding the board only decided to launch the review on Thursday after pressure from shareholders. “How other people interpret it is up to them,” he told reporters after the annual shareholders’ meeting on Friday.

Its shares jumped over 3% after the statement. The rise added almost £4bn to the value of HSBC – already one of the most valuable companies on the London stock market.

Chuka Umunna, shadow business secretary, said the warning over EU membership showed that the Conservatives were irresponsible in “playing fast and loose with the UK’s membership of the EU”.

He said the bank would be expected to take account of the wider regulatory context when deciding where to base its business but the warning about the EU was a new dimension.

The chancellor, George Osborne, said banks needed to be “properly regulated” but added that Labour’s policies would drive businesses overseas. “If we proceed in this country with an anti-business set of policies we are going to drive companies abroad, we are going to see jobs lost,” he said.

The HSBC board – under fire after leaks of the tax avoidance strategies used in its Swiss arm – took the decision on Thursday night after returning from an informal meeting of investors in Hong Kong, its base until 1992. Shareholder after shareholder had asked whether London was the correct home for the bank.

Flint said: “I said at our informal meeting in Hong Kong on Monday, we are beginning to see the final shape of regulation and of structural reform, including the requirement to ring fence in the UK.

“As part of the broader strategic review taking place, the board has therefore now asked management to commence work to look at where the best place is for HSBC to be headquartered in this new environment. The question is a complex one, and it is too soon to say how long this will take or what the conclusion will be; but the work is under way.”

The bank usually conducts a review of its head office location every three years. But the last one was in 2010 and it has not conducted one since because of the regulatory reforms imposed on banks after the 2008 financial crisis. This included the reforms to ringfence high street operations from investment banking arms – the Vickers reforms – and George Osborne’s bank levy.

Flint added: “One economic uncertainty stands out, that of continuing UK membership of the EU. In February we published a major research study which concluded that working to complete the single market in services and reforming the EU to make it more competitive were far less risky than going it alone, given the importance of EU markets to British trade.”

At the packed meeting Sir Simon Robertson, the deputy chairman, was forced to defend Flint and the chief executive Stuart Gulliver. “I want to make it absolutely clear the board has full confidence in both Douglas and Stuart and the rest of the management team.”

But shareholders registered their disapproval, with almost a quarter of them voting against the bank’s remuneration report. On the head office move, one shareholder asked: “Which country are you likely to go to? How many countries have you not committed illegal behaviour in?”

The bank employs 166,000 worldwide and about 48,000 are estimated to be in the UK, where HSBC moved its head office after the takeover of Midland Bank in 1992. Unions called for an urgent meeting to discuss the possible implications for staff.

Flint also apologised for the scandals to hit the bank: “I and my colleagues understand your disillusionment, share your frustration at having been let down, apologise for the inadequacies in controls that allowed unacceptable behaviours to occur undetected and accept responsibility for restoring HSBC’s reputation and standing to where they should be.”

Flint has been on the board since 1995 and is facing scrutiny along with other directors about the activities in HSBC’s Swiss banking arm between 2005 and 2007. Leaked account details showed how customers had been helped to avoid paying tax. This came after the bank was fined £1.1bn from the US authorities for money laundering offences.

Flint said: “HSBC has paid a heavy price. Our reputation has been damaged and the financial burden of the unacceptable behaviour has been borne by you, our shareholders in fines, penalties, additional costs and the opportunity costs arising from diversion of management time - this is clearly wrong.

“As new regulation which will clarify individual responsibility is embedded and fresh legislation comes into force that will widen the sanctions available to address the most egregious behaviour, I hope we will see much greater individual accountability visited on those directly responsible.”

Asked about HSBC, the prime minister, David Cameron said: “London is the world’s leading financial centre [and] has improved as a financial centre not least by changing the way we regulate banks so that we wouldn’t have to bail them out with taxpayers’ money in future as the last Labour government had to do.

“But it is an important reminder of how vital it is that we keep a pro enterprise, pro business, pro employment policy in our country. We need to keep taxes low, make this an attractive place to invest. All the time I have been Prime Minister that is what we have been doing, [with] record levels of inward investment coming here.”