Perfect matchings and the octahedron recurrence