Quantization of the Hall conductivity in the Harper-Hofstadter model