UV-induced photodesorption and photochemistry of O2 ice