Weak localization and integer quantum Hall effect in a periodic potential