Whisk milk, sugar, cornstarch, egg yolks and salt together in a medium saucepan. Cook over medium-low heat, whisking occasionally, until bubbling, 8 to 10 minutes. Continue cooking, whisking occasionally, until thickened, about 2 more minutes. The pudding should still be pourable and will thicken as it cools. Remove from heat and stir in butter and vanilla.