Long-range interactions, long-range order and a devil's staircase in YBa2Cu3Oz