I just want someone to talk to.

Literal

Conversation-partner [subject-が] wanted only [copula-です].

話し相手 is a compound noun: 話し (talking) + 相手 (partner/counterpart). だけ ('only, just') narrows the desire to one modest thing. The polite です softens what is essentially a plaintive expression of loneliness.