Renormalization as a functor on bialgebras