Galaxy pairs in cosmological simulations: effects of interactions on star formation