The air quality in Kuala Lumpur and surrounding areas was declared unhealthy as an acrid haze hung over the country's western states.