Electronic structure and optical properties of Ag-MoS2 composite systems