Structural changes with oxygen content and ordering of defects in the high-Tc oxide YBa2Cu3O6+x