maybe is not the best, but is a way the way i use is checking for the coordinates
i think your icon is a GUI, if so you have its position and its area
ie pos 0,0 50w50h in this case, when you click the screen the raycast is called, but before that i make a validation with Input.MousePosition, this give me x and y values,
lets say the mouse input was 49,35, if you check the GUI location, it is from 0 to 50 width and from 0 to 50 height, then if your values are inside these intervals, make the if statement to avoid running the part of moving your character
hope this is the answer you are looking,
or at least it helps