The Scottish Parliament has backed Nicola Sturgeon's call for the powers to hold a second independence referendum.