A deal will allow UN inspections of Iran's nuclear facilities to continue - but on more limited terms.