one has to be vigilant with android. It's an OS awash with security issues and by default gives apps free roam.
The first mistake was you wiped the phone meaning you now dont know what app it was, you panicked.
But basic configuring is restrict background data.
so settings
data usage
menu button
tick restrict background data.
After that generally you should goto the options of every app you install and turn of any options that might cause excessive battery use, data use etc.
I also would suggest a security app that can restrict data access on a per app basis, I usually use afwall (although this seems to have caused me some wifi 5ghz issues so is temporarily off). Other apps which can do that and more such as lbe security and xposed privacy. Those 2 apps can block apps accessing your contacts, sms etc. and as well as phone id and tracking.
After that is basic vigilance. Why do you leave 3g and data mode turned on when you sleep? get used to having the phone in 2g only by default and only turning on data access when you need it.