I feel like this approach can run into some problems:
1. Some people physically or mentally can't contribute to to disability or some other disorder.
2. Some people can't contribute because they were not provided with/are not provided with the opportunity to gain those skills.
3. It's very, very hard to quantify how much one contributes to society, especially when a task requires lots of people doing small things, or few people doing big things. Pay offers some signal for this in some cases, but at best it's talking about the economy - itself a proxy of society which layers on its own incentives.
I'm raising these three points because I know that if I were to respond with "That seems unfair and it's not the sort of society I'd like to live in" the counter response to that would likely be "we should aim for equality of opportunity, not equality of outcome". The point of my comment is to effectively say that it's very hard to measure opportunity and outcome when one takes into account individual circumstances, and it's even harder to get to the root of what we mean by 'equality' (mathematical equality? qualitatitve equality? quantitative equality? equality before the law?).