I am suprised at the number of people advocating what to me sounds like dangerous advice.
I have inadvertantly climbed into cloud several times, not usually on departure.
I fly an aeroplane that is very unsuited to instrument flying. I generally reduce power and descend. When it has happened to me I usually start descending before I have lost sight of the surface.
So, rule 1, pay attention! Keep looking out of the window and this shouldn't be a problem.
On all but one occasion, when I entered cloud while flying vertically upwards, I reduced power and regained sight of the surface in seconds. Ok, if there was high ground around, this may be a problem, but if there was high ground around I would know that, and it would already be a concern.
The advice to "continue the climb" sounds unwise to me, at least for a low hours, or non-instrument rated pilot. The fear of colision because you are doing something unexpected and not talking to ATC sounds like worrying about the wrong things too.
A low-hour, non-instrument rated pilot has climbed into cloud at below circuit height - where is the danger here? I would say the danger is of a stall-spin accident more than anything else.
So don't worry about ATC, don't try to out-climb the cloud, don't try to fly a 180 on instruments at low-level, reduce power a bit immediately you enter the cloud and pop back-out underneath. Sort yourself out below the clouds, in sight of the surface, and only then tell everyone what you are doing.
If you fly into another aeroplane while doing this, you are having a REALLY BAD DAY and are so incredibly unlucky that all bets are off anyway.
If you are flying in hilly-enough terrain that obstacles are a problem, AT BELOW CIRCUIT HEIGHT then you probably should have noticed the cloud below the top of the hills, or obscring the top of the mast before you took off - so Darwin has won again