Motion on extension of EU law to Northern Ireland is defeated at Stormont