Labour shifts policy, backing Brexit referendum