Magnetism and exchange coupling in iron pnictides