Maximum figure of merit of thermoelectric materials