Electrical and optical charging of CdTe quantum dots