Nearly 2.5 million people are not looking for work because of long-term sickness, adding to labour shortages.