We study the power and efficiency of an irreversible heat engine coupled to heating and cooling fluids with finite heat-capacity rates. We consider a specific model, for which the irreversibilities result from the finite rates of heat conductance and the internal irreversibility of the heat engine. The maximum power obtainable from such a system and the corresponding efficiency are derived analytically to provide more realistic limits on the performance of an irreversible heat engine than those obtained from a reversible heat engine. It is seen that two different optimal conditions must be determined. These are the optimal operating temperatures of the working fluids and the optimal allocation fraction of the heat conductance between the heating and cooling fluids. In the limit in which the heat-capacity rates approach infinity, the efficiency of an endoreversible heat engine at maximum power approaches the Curzon-Ahlborn efficiency. The calculated efficiency at maximum power is close to that actually observed in well-designed power plants.