Petrobras and Pemex have agreed to work together to discover, produce and refine oil.