First, as has been suggested, you might want to use a phototransistor instead of the photodiode. The phototransistor will conduct more current for a given light intensity, reducing system noise sensitivity.
Since you are directly driving the base of your 2N3904 transistor with the photodiode anode, the cathode connected to +5V, we need to look at the current gain of the transistor. When the transistor is saturated, the collector pulls about 0.22 mA through that 22K resistor. The current gain of that transistor is about 70 (minimum), so the required base current is about 3 uA. This is less than your typical reflective object current, so the transistor's gain is apparently around 200 -- slightly better than the typical value (which is pretty variable). To allow for transistor gain variation, we would like to see a safety factor of ten, and this is obviously not the case here. You need a higher-gain circuit, either a phototransistor detector, or perhaps a two-transistor circuit. A Darlington pair could work, or better yet a "Sziklai Pair" which would give you more voltage across your photodiode (a good thing). Either of these configurations will have a higher "on" voltage (saturation voltage) but with your 5V CMOS stage this shouldn't be a problem.
You will also want to have a high-value resistor from base to ground to keep any base leakage current or detector dark current from turning the transistor on. Obviously this also reduces the circuit's sensitivity. In the absense of any specs I would try 1 Megohm, but I see that floobydust suggests 47k and he may be right.