Electronic structure of rare-earth nickel pnictides: Narrow-gap thermoelectric materials