Oxygen vacancy ordering and superconductivity in YBa2Cu3O7−x