Deal 'in principle' agreed over occupied Karabakh