Italy and Libya have agreed to reactivate a friendship treaty signed a decade ago that allowed migrants to be returned to Libyan territory.