Baghdad and Erbil agree to resolve oil dispute