Yes, the relative pronoun which is correct here. The first reading of the sentence might be confusing to some because of the "distance" between the pronoun and its antecedent. Probably not to worry, though.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.