Spin evolution and feedback of supermassive black holes in cosmological simulations