Israel and Lebanon have reached a historic agreement settling a years-long maritime border dispute involving major oil and gas fields in the Mediterranean.