Effect of contacts on terahertz plasma resonances in two-dimensional electron systems