The upper house of parliament voted for power to reject the final terms of the country's exit from the European Union.