Existence of solution to a critical trace equation with variable exponent