Officials representing European institutions and the IMF have completed the draft of an agreement to unlock bailout aid for Greece, according to people familiar with the talks.