Hyperfine structure and line formation in a magnetic field