Combine sugar, milk, egg yolks, and butter in a medium saucepan. Cook, stirring constantly, over medium heat until the mixture is thickened and bubbling gently around the edges. Reduce the heat to low and cook, stirring for 1 to 2 minutes more. Remove from heat and stir in the coconut and pecans. Let cool until spreadable. This keeps, refrigerated, for about 1 week. Soften before using.