The figure below, from Bill Gates's annual letter, shows that countries with a higher disease burden have lower average IQs. The theory is that building brains and fighting disease are metabolically costly so more effort to fend disease diverts resources from brain development lowering IQ.
Tyler blogged this research earlier writing "I'm not sure the authors have a very good test against alternative hypotheses, but still a correlation remains after making some appropriate adjustments."
Further evidence on causality is given by Atheendar Venkataramani in Early Life Exposure to Malaria and Cognition and Skills in Adulthood. Venkataramani finds that men born after widespread malaria eradication began in Mexico in the late 1950s have higher IQs (Raven scores) and are more likely to work in white collar jobs than men born shortly before eradication efforts began. Importantly, the effect is larger for men born in those states that began with high exposure to malaria.