No, distributions you receive as a shareholder of an S corporation do not constitute earned income for retirement plan purposes. You can only include the compensation you received from the S Corp, in the form of W-2 Wages.
Isabella I think you are confusing "distributions" with K-1's Part III Box 1 income (which is the subject matter).
A general rule of thumb is that if the income is subject to FICA / Medicare taxes, then it is considered earned income in the eyes of the IRS.