Junction box in closet partially covered by wall
I have three things to tell you.


That can't possibly be a legal installation. Junction boxes must remain accessible and cannot be walled up. Even partially covering one like that is going to cause the inspector to plotz. Also, it's obviously a NM extension to a knob-and-tube circuit, which is no longer allowed in most venues. Plus, even if it's legal, you have an ungrounded fault ground wire and no place to ground it. Whatever that NM leads to may appear to be grounded which is a dangerous deception. 

The reason I think the NM ground wire is ungrounded is because I assume the power is coming into the box via the older cable, since newer cable is usually used to physically extend a circuit. However sometimes newer cable appears between the service panel and older cable, so OP should disconnect the hots and test with a volt meter. 
I am not a licensed electrician so my advice may raise some eyebrows. I think you can add a light to the closet without substantially increasing the danger to your home and person. Screw a metal hex box to the ceiling of the closet and mount the pullchain light on that. Connect the ceiling box to the existing box with plastic conduit, and pull two wires to connect the lamp to the wire nuts in the existing box. 

Use the proper fittings to connect the conduit to the boxes. You'll have to knock out one of the openings in the existing box. You may want to use larger wire nuts to accommodate the three wires. Try to figure out the gauge of the wires in the existing box and size your new wires to match them; this helps protect some future occupant who might plug a toaster into your light fixture. 

I would use a needle-nose pliers to wind that bare ground wire into a small coil, and wrap some tape around it to keep it from touching the metal box. This eliminates one way to get a shock if some appliance on that NM cable goes bad. Then, close up the existing box with a proper metal cover plate and try not to think about it. 
Many licensed electricians post answers and advice on this site. If they disagree with me, you should listen to them. I tend to give advice consonant with how I maintain my own house, and I may be taking more risks than you would be comfortable with.