Talks on returning as an associate member after Brexit row are close to agreement, say diplomatic sources