If your cucumber plant has only a few yellow leaves and you’re confident that a communicable plant disease isn’t behind the discoloration, you can safely prune the affected leaves off.  Especially if the yellowing is due to sunlight, watering or nutrient deficiency, the leaves will fall off on their own.