Combinatorial Problem similar in nature to a special version of max weighted matching problem
Maximum Weight Matching algorithms are incremental, so to achieve a maximum weight matching of a bounded size, just stop after so many iterations. To achieve the other constraint, For each terminal vertex in $\mathcal{V}'$, increase the weight of each incident edge by a huge constant amount $U$. Try to prove that this answers your question (note that edges incident to two terminals have to be increased twice to keep the total increase constant in all valid solutions).
Note. It might help in the proof to distinguish different cases according to the size of $\mathcal{V}'$ compared to $k$ (the size of the matching).