Ergodic theorems for noncommutative dynamical systems