You can use
Llama. Unlike Tasker, Llama is free. Llama is very intuitive. It's what I use.
In your case, you would create 2 complementary "Events" in Llama whereby you would select trigger-conditions and the resulting actions from a menu of options like "Screen off", "Mobile data off", etc. (E.g. Let's name the 2 events "Screen-Data-Off" and "Screen-Data-On".)
Screen-Data-Off
Condition: Screen off
Action: Mobile Data off. WiFi off.
Screen-Data-On
Condition: Screen on
Action: Mobile Data on. WiFi on.
For your posted need, you probably only need to take advantage of Llama's "Event" functionality described below. ("Event" isn't a very intuitive name. It's really an If-Then function.) But Llama can do so much more. So following is more detailed information about how to use Llama (that I cut and pasted from a reply that I made many months ago)...
Profiles: You can create profiles to behave certain ways, like creating a "Silent" profile for when you're in church or a movie theater. From the top select Profiles and hit the "+" on the bottom to create a new profile or just edit an existing one. You don't have to create profiles but they can be very useful.
Areas: You can teach Llama different locations based on the cell towers that are "visible" to the phone. For example, you may want to teach Llama where your home, office, church, movie-theater are-- and assign them a name. Then later you can have Llama perform different actions when the phone enters, leaves, is inside, or outside that location. You have to be in that location to teach Llama to recognize it. To do so, select "Areas" from the top and "+" at the bottom. It will walk you through.
Events: These are really "If-Then" commands, where the "If's" are what Llama calls "Conditions" and the "Thens" are what Llama calls "Actions". Examples:
- "Church Quiet" event:
- (If) Condition is Area church.
- (Then) Action is "Quiet" profile.
- "In-Car" event:
- (If) Condition is Bluetooth connected to car stereo AND condition is charging.
- (Then) Actions are, Brightness full, Volume full, screen-time-out off, launch Waze-GPS, & launch Pandora.
Typically you want to create these "Events" in oppositely-functioning pairs so that, for example, when you leave church you go back to a Normal profile and when you disconnect from your car's stereo, you undo the aforementioned settings and kill the apps. To create an "Event" tap on "Events" at the top. Then select the "Conditions" and then the "Actions".
Advanced: When editing an "Event" you'll see a menu option called "Advanced...". If you select that, you can control things like "Delay Event" to delay the action taken and "Repeat Event" where you can choose whether or not to repeat it at a user-defined interval.
I hope that helps.