Early retirement and ill health are driving premature exits from the workforce and having a major impact on the UK economy, with an estimated £31bn in lost output annually, according to a new study.